package com.risenb.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

import com.risenb.bean.Manager;
import com.risenb.bean.Page;
import com.risenb.bean.PremissionItem;

public interface ManagerMapper {
	
    int removeManagerById(Integer id);

    int createManager(Manager record);

    Manager queryManagerById(Integer id);

    int modifyManagerById(Manager record);

    /**
     * 分页
     * @param page
     * @return
     */
    List<Manager> queryByPage(Page<Manager> page);
    
    /**
     * 根据条件查询管理员信息
     * @param manager
     * @return
     */
    Manager queryManager(Manager manager);
    
    //批量删除
    int removeManagerByIds(List<String> delids);
    
    //验证邀请码
    @Select("select count(*) from manager where idkey = #{invitecode,jdbcType=VARCHAR}")
    @ResultType(java.lang.Integer.class)
    int queryCountByIdKey(@Param("invitecode")String invitecode);
    
    @Select("select * from manager")
    @ResultType(Manager.class)
    List<Manager> queryAlls();
    
    List<Manager> queryAll(List<String> expids);

    /**
     * 获取用户的权限
     * @return
     */
    List<PremissionItem> queryPremission(String username);

    /**
     * 根据条件查询管理员信息
     * @param manager
     * @return
     */
	Manager queryManagerTwo(Manager manager);
	
}